import React from 'react'
import { useNavigate } from '@/.umi/exports'
import { NavBar } from 'antd-mobile'
import './StyleCommonHead.less'

export default function CommonHead(props: { title: string }) {
    // props接收 商品详情 商品名
    const navigate = useNavigate()
    const back = () => {
        navigate(-1)
    }
    return (
        <div className='NavBar-CommonHead'>
            <NavBar back='返回' onBack={back}>
                {props.title}
                {/* props接收 商品详情 商品名 */}
            </NavBar>
        </div>
    )
}
